const Redis = require("ioredis");
const config = require("../config/config.json");
const redisClient = new Redis({
  host: config.redis.host, // Redis 服务的地址
  port: config.redis.port, // Redis 服务的端口
  password: "", // 如果设置了密码，请提供密码
});

redisClient.on("connect", () => {
  console.log("connected to Redis");
});

redisClient.on("error", (err) => {
  console.error("Redis connection error:", err);
});

module.exports = redisClient;
